/**
 * 招聘人员API
 */

import request from '@/utils/request'

/**
 * 招聘人员列表
 * @param {*} data
 * @returns
 */
export function hrmRecruitUserQueryListAPI(data) {
  return request({
    url: 'hrmRecruitUser/queryRecruitUserPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 招聘人员详情
 * @param {*} recruitUserId
 * @returns
 */
export function hrmRecruitUserQueryByIdAPI(recruitUserId) {
  return request({
    url: `hrmRecruitUser/queryById/${recruitUserId}`,
    method: 'post'
  })
}

/**
 * 新增招聘人员
 * @param {*} data
 * @returns
 */
export function hrmRecruitUserAddAPI(data) {
  return request({
    url: 'hrmRecruitUser/addRecruitUser',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 修改招聘人员
 * @param {*} data
 * @returns
 */
export function hrmRecruitUserSetAPI(data) {
  return request({
    url: 'hrmRecruitUser/setRecruitUser',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 删除招聘人员
 * @param {*} data
 * @returns
 */
export function hrmRecruitUserDeleteAPI(data) {
  return request({
    url: 'hrmRecruitUser/batchDeleteRecruitUser',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 导出招聘人员
 * @param {*} data
 * @returns
 */
export function hrmRecruitUserExportAPI(data) {
  return request({
    url: 'hrmRecruitUser/exportRecruitUser',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    responseType: 'blob'
  })
}

/**
 * 招聘人员导入模板
 */
export function userImportTemplateAPI() {
  return request({
    url: 'hrmRecruitUser/downloadExcel',
    method: 'post',
    responseType: 'blob'
  })
}

/**
 * 招聘人员Excel导入
 */
export function userExcelImportAPI(data) {
  const formData = new FormData()
  formData.append('file', data.file)
  return request({
    url: 'hrmRecruitUser/excelImport',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 上报招聘人员
 */
export function hrmRecruitUserReportAPI() {
  return request({
    url: 'hrmRecruitPlan/syncRecruitUser',
    method: 'post'
  })
}

